home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / RCS / SpinEvent.cc,v < prev    next >
Text File  |  1989-05-09  |  1KB  |  111 lines

  1. head     3.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    grunwald:3.2; strict;
  6. comment  @@;
  7.  
  8.  
  9. 3.2
  10. date     89.02.20.15.37.34;  author grunwald;  state Exp;
  11. branches ;
  12. next     3.1;
  13.  
  14. 3.1
  15. date     88.12.20.13.49.18;  author grunwald;  state Exp;
  16. branches ;
  17. next     1.2;
  18.  
  19. 1.2
  20. date     88.10.30.13.04.39;  author grunwald;  state Exp;
  21. branches ;
  22. next     1.1;
  23.  
  24. 1.1
  25. date     88.09.28.22.13.23;  author grunwald;  state Exp;
  26. branches ;
  27. next     ;
  28.  
  29.  
  30. desc
  31. @@
  32.  
  33.  
  34. 3.2
  35. log
  36. @Start using Gnu library heaps for schedulers
  37. @
  38. text
  39. @// This may look like C code, but it is really -*- C++ -*-
  40. // 
  41. // Copyright (C) 1988 University of Illinois, Urbana, Illinois
  42. //
  43. // written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
  44. //
  45. #include "SpinEvent.h"
  46. #include "Pragma.h"
  47.  
  48. PRAGMA_LINKAGE_C
  49. extern int getpid();
  50. PRAGMA_LINKAGE
  51.  
  52. void
  53. SpinEvent::waitFor()
  54. {
  55.     int timesAround = 0;
  56.  
  57.     reserve();
  58.     int gen = generation;
  59.     garcon++;
  60.     release();
  61.  
  62.     //
  63.     // Waiting people just read generation, and the final process
  64.     // just writes it, so we do not really even need to use the locks here.
  65.     //
  66.     
  67.     while ( gen == generation ) {
  68.     if (timesAround > pLoops) {
  69.         (void) getpid();
  70.         timesAround = 0;
  71.     }
  72.     timesAround++;
  73.     }
  74. }
  75. @
  76.  
  77.  
  78. 3.1
  79. log
  80. @Steay version
  81. @
  82. text
  83. @@
  84.  
  85.  
  86. 1.2
  87. log
  88. @*** empty log message ***
  89. @
  90. text
  91. @d8 1
  92. d10 1
  93. d12 1
  94. a12 1
  95.  
  96. @
  97.  
  98.  
  99. 1.1
  100. log
  101. @Initial revision
  102. @
  103. text
  104. @d1 7
  105. a7 1
  106. #include "HardEvent.h"
  107. d13 1
  108. a13 1
  109. HardEvent::waitFor()
  110. @
  111.